package com.mebs.edi.model.edi.e214;

import javax.persistence.Column;
import javax.persistence.Embeddable;

import com.mebs.edi.model.dom.DomAttribute;
import com.mebs.edi.model.dom.DomEntity;

/**
 * 
 * N3 section of a 214 EDI file 
 * 
 * @author nit
 *
 */
@Embeddable
@DomEntity(name = "N3")
public class Edi214N3 {
	
	@Column(nullable = true, length = 60)
	@DomAttribute
	private String n301; 	// Pickup Address Line 1
	
	@Column(nullable = true, length = 60)
	@DomAttribute
	private String n302; 	// Pickup Address Line 2
	
	public Edi214N3() {
		super();
	}

	public String getN301() {
		return n301;
	}

	public void setN301(String n301) {
		this.n301 = n301;
	}

	public String getN302() {
		return n302;
	}

	public void setN302(String n302) {
		this.n302 = n302;
	}

	@Override
	public String toString() {
		return "Edi214N3 [n301=" + n301 + ", n302=" + n302 + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((n301 == null) ? 0 : n301.hashCode());
		result = prime * result + ((n302 == null) ? 0 : n302.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Edi214N3 other = (Edi214N3) obj;
		if (n301 == null) {
			if (other.n301 != null)
				return false;
		} else if (!n301.equals(other.n301))
			return false;
		if (n302 == null) {
			if (other.n302 != null)
				return false;
		} else if (!n302.equals(other.n302))
			return false;
		return true;
	}
}
